You can use the functions KCCountKeychains and KCGetIndKeychain to obtain a keychain reference corresponding to an indexed keychain. Pass a value between 1 and the number returned by the function KCCountKeychains in the index parameter of KCGetIndKeychain.